interface LoadingProps {
  size?: 'small' | 'medium' | 'large';
  showText?: boolean;
  className?: string;
}

export default function Loading({ 
  size = 'medium', 
  showText = true,
  className = ''
}: LoadingProps) {
  // 根据不同大小设置样式
  const sizeStyles = {
    small: 'h-6 w-6 border-t-2 border-b-2',
    medium: 'h-10 w-10 border-t-2 border-b-2',
    large: 'h-16 w-16 border-t-2 border-b-2'
  };
  
  // 根据不同大小设置容器padding
  const containerPadding = {
    small: 'py-4',
    medium: 'py-8',
    large: 'py-16'
  };
  
  return (
    <div className={`flex flex-col items-center justify-center ${containerPadding[size]} ${className}`}>
      <div className={`animate-spin rounded-full ${sizeStyles[size]} border-red-600 ${showText ? 'mb-3' : ''}`}></div>
      {showText && (
        <p className={`text-gray-400 ${size === 'small' ? 'text-xs' : 'text-sm'}`}>
          正在加载中...
        </p>
      )}
    </div>
  );
} 